package edu.jxnu.zhangjinsong.unemploymenttracker.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@TableName("task")
public class Task {
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;
    
    @TableField
    private String title;
    
    @TableField
    private String description;
    
    @TableField("person_id")
    private String personId;
    
    @TableField("assigner_id")
    private String assignerId;
    
    @TableField("assignee_id")
    private String assigneeId;
    
    @TableField
    private String status;
    
    @TableField
    private LocalDate deadline;
    
    @TableLogic
    @TableField("is_deleted")
    private Integer isDeleted;
    
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    public enum TaskStatus {
        待分配, 进行中, 已完成, 已取消
    }
}